export const setTitle = (title: string) => {
  document.title = title
  if (isIOS) {
    const iframe = document.createElement('iframe')
    iframe.src = '/favicon.ico'
    iframe.style.display = 'none'
    iframe.onload = () => {
      setTimeout(() => {
        iframe.remove()
      }, 10)
    }
    document.body.appendChild(iframe)
  }
}

export const UA = window.navigator.userAgent.toLowerCase()
export const isAndroid = UA && UA.indexOf('android') > 0
export const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA)
